package net.gazhi.delonix.grac.web.controller;

import java.util.List;

import net.gazhi.delonix.core.web.AbstractAnnotationController;
import net.gazhi.delonix.grac.entity.gru.UserDir;
import net.gazhi.delonix.grac.service.UserDirService;
import net.gazhi.delonix.grac.web.annonation.Handler;

import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Controller;
import org.springframework.web.bind.annotation.RequestMapping;
import org.springframework.web.servlet.ModelAndView;

@Controller
@RequestMapping("/grac/user")
@Handler(zh = "用户管理", en = "Users")
public class UserController extends AbstractAnnotationController {

	@Autowired
	private UserDirService userDirService;

	@RequestMapping("/home")
	@Handler(zh = "首页面", en = "Home Page", redirectable = true)
	public ModelAndView home() {
		List<UserDir> dirs = this.userDirService.listAll();
		return new ModelAndView().addObject("dirs", dirs);
	}
	
}
